package com.margo.project.redis.message.action;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MargoMessageController {
	private Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private StringRedisTemplate stringRedisTemplate;
	
	@RequestMapping("/message")
	public String priceReceive() {
		logger.info("message");
		stringRedisTemplate.convertAndSend("FORECLOSURE_TOPIC", "hello world!");
		return "success";
	}
}
